Skip to content

Conversation

@2mawi2
Copy link
Contributor

@2mawi2 2mawi2 commented Jan 1, 2026

Fixes #7017

What

  • Prevent MCP startup completion from clearing the "task running" UI state during an active agent turn (spinner/status indicator stays visible; Esc interrupt keeps working).

Why

  • McpStartupComplete could call bottom_pane.set_task_running(false) while an agent turn was still running, hiding the status indicator and disabling Esc interrupt.

How

  • Track agent_turn_running separately and set effective running state as agent_turn_running || mcp_startup_status.is_some() (applied to both codex-rs/tui and codex-rs/tui2).
  • Add regression tests ensuring McpStartupComplete does not clear task_running/status indicator after TaskStarted.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 1, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@2mawi2
Copy link
Contributor Author

2mawi2 commented Jan 1, 2026

I have read the CLA Document and I hereby sign the CLA

@etraut-openai
Copy link
Collaborator

@codex review

@chatgpt-codex-connector
Copy link
Contributor

Codex Review: Didn't find any major issues. Nice work!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@etraut-openai
Copy link
Collaborator

@2mawi2, thanks for the contribution. Sorry for the slow reply — we got behind over the holidays, but we're now back and going through the queue.

Could you please fix the merge conflicts?

@etraut-openai etraut-openai added the needs-response Additional information is requested label Jan 7, 2026
@2mawi2
Copy link
Contributor Author

2mawi2 commented Jan 8, 2026

@etraut-openai done and tested one more time!

@etraut-openai etraut-openai removed the needs-response Additional information is requested label Jan 8, 2026
@joshka-oai joshka-oai self-assigned this Jan 10, 2026
2mawi2 and others added 2 commits January 13, 2026 13:09
ChatWidget treats the bottom-pane "task running" indicator as a derived
UI-busy signal.

The UI can be busy for two independent reasons: an agent turn
(TurnStarted..complete/abort) and MCP startup
(McpStartupUpdate..McpStartupComplete). Document the invariant that the
bottom-pane indicator is driven by agent_turn_running ||
mcp_startup_status.is_some(), and that turn cleanup does not clear MCP
startup tracking.

Also add brief module headers to the ChatWidget test modules and
clarify the MCP startup completion regression test intent.
@joshka-oai joshka-oai force-pushed the fix/mcp-startup-task-running branch from a101896 to be54e27 Compare January 13, 2026 21:16
@joshka-oai
Copy link
Collaborator

I rebased against main, and added a few docs to help clarify how this works. Thanks for the PR. Looks great

@joshka-oai joshka-oai enabled auto-merge (squash) January 13, 2026 21:18
@joshka-oai joshka-oai merged commit 3c711f3 into openai:main Jan 13, 2026
26 of 32 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jan 13, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Loading spinner not showing when starting codex with initial prompt

3 participants